package com.example.mybatisplusdemo.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.example.mybatisplusdemo.model.domain.Rating;
import com.example.mybatisplusdemo.model.dto.StarCountDTO;
import org.apache.ibatis.annotations.MapKey;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author lxp
 * @since 2025-07-04
 */
public interface RatingMapper extends BaseMapper<Rating> {

    Rating selectByReviewId(@Param("reviewId") Long id);

    void deleteByReviewId(@Param("reviewId") Long reviewId);

    List<StarCountDTO> getRatingDistribution();
}
